﻿using System.Collections.Generic;
using Web_Oto.Bases;
using Web_Oto.Data;

namespace Web_Oto.Business
{
    public class ConsultServiceBus : busObject
    {
        #region Constructor

        public ConsultServiceBus()
        {
            m_objDAL = new ConsultServiceDal(connectionstring, connectiontype);
        }

        public ConsultServiceBus(string connectionString)
            : base(connectionString)
        {
            m_objDAL = new ConsultServiceDal(connectionstring, connectiontype);
        }

        public ConsultServiceBus(string connectionString, string connectionType)
            : base(connectionString, connectionType)
        {
            m_objDAL = new ConsultServiceDal(connectionstring, connectiontype);
        }

        private ConsultServiceDal m_objDAL;

        #endregion

        #region methods

        public IList<ConsultService> GetAllConsultService(string name = "", string intro = "")
        {
            return m_objDAL.GetAllConsultService(name, intro);
        }

        public IList<ConsultService> GetAllConsultService(int? currentPage, int itemPerPage, out int totalRecord)
        {
            return m_objDAL.GetAllConsultService(currentPage, itemPerPage, out totalRecord);
        }

        public IList<ConsultService> GetTopServices(int countItems)
        {
            return m_objDAL.GetTopServices(countItems);
        }

        public IList<ConsultService> GetAnotherConsultService(int id)
        {
            return m_objDAL.GetAnotherConsultService(id);
        }

        public ConsultService GetNewsById(int id)
        {
            return m_objDAL.GetNewsById(id);
        }

        public int Delete(int id)
        {
            return m_objDAL.Delete(id);
        }

        public int Update(ConsultService consultService)
        {
            return m_objDAL.Update(consultService);
        }

        public int Insert(ConsultService consultService)
        {
            return m_objDAL.Insert(consultService);
        }

        public string GetFilePathById(int id)
        {
            return m_objDAL.GetFilePathById(id);
        }

        #endregion
    }
}
